<template>
  <!-- 房产列表部分 -->
  <el-card class="box-card box">
    <el-table :data="propertiesList" border style="width: 100%">
      <el-table-column prop="" label="封面" align="center">
        <template v-slot="{ row }">
          <img
            :src="row.image"
            title="点击查看大图"
            class="img"
            @click="previewImg($event)"
          >
        </template>
      </el-table-column>
      <el-table-column prop="title" label="标题" align="center" />
      <el-table-column prop="tags" label="标签" align="center" />
      <el-table-column prop="address" label="地址" align="center" />
      <el-table-column prop="category" label="分类" align="center">
        <template v-slot="{ row }">
          <el-tag
            v-for="(item, index) in row.category"
            :key="index"
            type="success"
          >{{ item }}</el-tag>
        </template>
      </el-table-column>
      <el-table-column prop="agent" label="经纪" align="center">
        <template v-slot="{ row }">
          <p>{{ row.agent === null ? "" : row.agent.name }}</p>
        </template>
      </el-table-column>
      <el-table-column prop="price" label="价格" align="center" />
      <el-table-column prop="desc" label="介绍" align="center">
        <template v-slot="{ row }">
          <p :title="row.desc" class="text">{{ row.desc }}</p>
        </template>
      </el-table-column>
      <el-table-column prop="photos" label="图片" width="240" align="center">
        <template v-slot="{ row }">
          <img
            v-for="(item, index) in row.photos"
            :key="index"
            :src="item"
            title="点击查看大图"
            class="img"
            @click="previewImg($event)"
          >
        </template>
      </el-table-column>
      <el-table-column prop="address" label="操作" align="center">
        <template v-slot="{ row }">
          <el-button
            type="danger"
            class="btn"
            @click="delFn(row.id)"
          >删除</el-button>
          <el-button type="primary" class="btn">编辑</el-button>
        </template>
      </el-table-column>
    </el-table>
  </el-card>
</template>

<script>
export default {

}
</script>

<style>

</style>
